<?php
/**
 * This is the index.ctp
 * @access public
 * @version 1.0
 */
$loggedUser =  $authUser;
$loggedUser_id = $loggedUser['id'];
$modified_date = date('Y-m-d H:i:s');
$created_date = date('Y-m-d H:i:s');
?>
<!-- Main content -->
<section role="main" id="main">
    <!-- Header -->
    <?php
        echo $this->element('page_header');
        echo $this->element('navigations/admin_navbar');
    ?>

    <div class="with-padding">
        <div class="columns">
            <div class="new-row-mobile twelve-columns six-columns-tablet twelve-columns-mobile">

                <h3 class="thin underline">Users</h3>

               <table id="flex" style="display:none;"></table>

                <div style="display: none;">
                    <div id="user-form-window" style="margin: 20px 5px 5px 5px;">
                        <div class="user-prompt" ></div>
                        <?php echo $this->Form->create('User', array('default' => false, 'id' => 'user-form', 'action' => 'add','inputDefaults' => array('label' => false,'div' => false)));?>
                        <fieldset class="fieldset">
                            <legend class="legend">Info</legend>

                            <p class="button-height inline-label">
                                <label class="label">Username</label>
                                <?php echo $this->Form->input('username', array('id'=>'username', 'class' => 'input validate[required] ', 'value'=>'', 'div' => false, 'label' => false,)); ?>
                            </p>
                            <p class="button-height inline-label">
                                <label class="label">First Name</label>
                                <?php echo $this->Form->input('first_name', array('id'=>'first_name', 'class' => 'input validate[required] ', 'value'=>'', 'div' => false, 'label' => false,)); ?>
                            </p>
                            <p class="button-height inline-label">
                                <label class="label">Last Name</label>
                                <?php echo $this->Form->input('last_name', array('id'=>'last_name', 'class' => 'input validate[required] ', 'type'=>'text' ,'value'=>'', 'div' => false, 'label' => false,)); ?>
                            </p>
                            <p class="button-height inline-label">
                                <label class="label">Password</label>
                                <?php echo $this->Form->input('password', array('id'=>'password', 'type'=>'password', 'class' => 'input validate[required] ', 'value'=>'', 'div' => false, 'label' => false,)); ?>
                            </p>
                            <p class="button-height inline-label">
                                <label class="label">User Group</label>
                                <?php echo $this->Form->input('group_id', array('id'=>'group_id', 'class' => 'select expandable-list validate[required]','style'=>'width:105px;', 'options'=>$groupOpt, 'div' => false, 'label' => false,)); ?>
                            </p>
                            <p class="button-height inline-label">
                                <label class="label">Active</label>
                                <?php echo $this->Form->input('active', array('id'=>'active', 'class' => 'select expandable-list validate[required] ','style'=>'width:105px;', 'options'=>array('y'=>'Active', 'n'=>'Inactive'), 'div' => false, 'label' => false,)); ?>
                            </p>

                            <p class="button-height inline-label">
                                <label for="save-btn" class="label">&nbsp;</label>
                                <button type="submit" class="button" id="save-btn">
                                    <span class="button-icon green-gradient"><span class="icon-download"></span></span>
                                    Save
                                </button>

                                <button type="button" class="button" id="cancel-btn">
                                    <span class="button-icon anthracite-gradient"><span class="icon-cross-round"></span></span>
                                    Cancel
                                </button>
                            </p>
                        </fieldset>
                        <?php echo $this->Form->end();?>
                        <input type="hidden" name="modules_count" id="modules_count_id" value="<?php echo count($allModules);?>"/>
                    </div>
                </div>

                <!--   <div id="mekgrid1" class="mgridwrapper">
                    <div class="tbDiv">
                        <span class="button-group" style="height: auto;">
                            <a href="javascript:void(0)" class="button icon-star">Create</a>
                            <a href="javascript:void(0)" class="button icon-download">Save</a>
                            <a href="javascript:void(0)" class="button icon-new-tab">Duplicate</a>
                            <a href="javascript:void(0)" class="button icon-trash">Delete</a>
                        </span>
                    </div>
                    <div class="tdDiv" style="height: 200px;">
                        <table id="" class="table table-bordered">
                            <thead>
                            <tr>
                                <th>Id</th>
                                <th>Name</th>
                                <th>Age</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td>1</td>
                                <td>Abigail</td>
                                <td>20</td>
                            </tr>
                            <tr>
                                <td>2</td>
                                <td>Jean</td>
                                <td>28</td>
                            </tr>
                            <tr>
                                <td>3</td>
                                <td>Fletcher</td>
                                <td>29</td>
                            </tr>
                            <tr>
                                <td>1</td>
                                <td>Abigail</td>
                                <td>20</td>
                            </tr>
                            <tr>
                                <td>2</td>
                                <td>Jean</td>
                                <td>28</td>
                            </tr>
                            <tr>
                                <td>3</td>
                                <td>Fletcher</td>
                                <td>29</td>
                            </tr>
                            <tr>
                                <td>1</td>
                                <td>Abigail</td>
                                <td>20</td>
                            </tr>
                            <tr>
                                <td>2</td>
                                <td>Jean</td>
                                <td>28</td>
                            </tr>
                            <tr>
                                <td>3</td>
                                <td>Fletcher</td>
                                <td>29</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="sbDiv">
                        Find <input type="text" size="30"/>
                        On <select><option>Name</option></select>
                        <a href="javascript:void(0)" class="button">Go</a>
                    </div>
                    <div class="pDiv">
                        <span class="button-group" style="height: auto;">
                            <a href="javascript:void(0)" class="button icon-search icon-size2"></a>
                            <a href="javascript:void(0)" class="button icon-previous icon-size2"></a>
                            <a href="javascript:void(0)" class="button icon-left icon-size2"></a>
                        </span>
                        Page <input type="text" size="4"/> of 1
                        <span class="button-group" style="height: auto;">
                            <a href="javascript:void(0)" class="button icon-right icon-size2"></a>
                            <a href="javascript:void(0)" class="button icon-next icon-size2"></a>
                            <a href="javascript:void(0)" class="button icon-redo icon-size2"></a>
                        </span>
                        Displaying 1 to 1 of 1 items
                    </div>

                </div>-->

                <!--<div class="side-tabs same-height margin-bottom">
                    <ul class="tabs">
                        <li class="active"><a href="#sidetab-1">Selected tab</a></li>
                        <li><a href="#sidetab-2">Another tab</a></li>
                    </ul>
                    <div class="tabs-content">
                        <div id="sidetab-1" class="with-padding">
                            Selected tab
                        </div>
                        <div id="sidetab-2" class="with-padding">
                            Alternate tab 1
                        </div>
                    </div>
                </div>-->

            </div>
        </div>
    </div>

</section>
<!-- End main content -->

<!-- Side tabs shortcuts -->
<?php echo $this->element('side_tabs_shortcuts'); ?>
<!-- Sidebar/drop-down menu -->
<?php echo $this->element('right_side_infos'); ?>

<!-- URL -->
<input type="hidden" id="table-url" value="<?php echo $this->Html->url(array('controller' => 'Administration', 'action' => 'getUsers')); ?>" />
<input type="hidden" id="add-edit-url" value="<?php echo $this->Html->url(array('controller' => 'Administration', 'action' => 'add')); ?>" />
<input type="hidden" id="load-user-url" value="<?php echo $this->Html->url(array('controller' => 'Administration', 'action' => 'loadUser')); ?>" />
<input type="hidden" id="delete-url" value="<?php echo $this->Html->url(array('controller' => 'Administration', 'action' => 'deleteUsers')); ?>" />

<?php
echo $this->Html->script('setup.js');
/** Template functions **/
echo $this->Html->script('developr.input.js');
echo $this->Html->script('developr.message.js');
echo $this->Html->script('developr.modal.js');
echo $this->Html->script('developr.navigable.js');
echo $this->Html->script('developr.notify.js');
echo $this->Html->script('developr.scroll.js');
echo $this->Html->script('developr.progress-slider.js');
echo $this->Html->script('developr.tooltip.js');
echo $this->Html->script('developr.confirm.js');
echo $this->Html->script('developr.agenda.js');
echo $this->Html->script('developr.tabs.js');
echo $this->Html->script('libs/tinycon.min.js');
echo $this->Html->script('flexigrid.js');
echo $this->Html->script('jquery.thfloat-0.3.min.js');
echo $this->Html->script('custom-scripts/admin/users.js');

?>